<template>
  <div class="hm-son">
    我是子组件---{{ num }}-----{{ obj }}----{{ strType }}
  </div>
</template>
<script>
export default {
  //   props: ['num']
  props: {
    num: {
      type: Number,
      default: 999
    },
    obj: {
      type: Object,
      default: () => ({})
      //   default: () => {
      //     return {}
      //   }
    },
    strType: {
      type: String,
      required: true,
      validator: value => {
        const arr = ['all', 'active', 'completed']
        return arr.includes(value)
      }
    }
  }
}
</script>
<style scoped>
.hm-son {
  width: 300px;
  height: 300px;
  border: 3px solid red;
}
</style>
